Optimal. Leaf size=53 \[ \frac{(a+b)^2 \log (\sin (e+f x))}{f}-\frac{b (2 a+b) \log (\cos (e+f x))}{f}+\frac{b^2 \sec ^2(e+f x)}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0738816, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4138, 446, 88} \[ \frac{(a+b)^2 \log (\sin (e+f x))}{f}-\frac{b (2 a+b) \log (\cos (e+f x))}{f}+\frac{b^2 \sec ^2(e+f x)}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4138
Rule 446
Rule 88
Rubi steps
\begin{align*} \int \cot (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{\left (b+a x^2\right )^2}{x^3 \left (1-x^2\right )} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{(b+a x)^2}{(1-x) x^2} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (-\frac{(a+b)^2}{-1+x}+\frac{b^2}{x^2}+\frac{b (2 a+b)}{x}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{b (2 a+b) \log (\cos (e+f x))}{f}+\frac{(a+b)^2 \log (\sin (e+f x))}{f}+\frac{b^2 \sec ^2(e+f x)}{2 f}\\ \end{align*}
Mathematica [A] time = 0.22654, size = 84, normalized size = 1.58 \[ \frac{2 (a \cos (e+f x)+b \sec (e+f x))^2 \left (2 \cos ^2(e+f x) \left ((a+b)^2 \log (\sin (e+f x))-b (2 a+b) \log (\cos (e+f x))\right )+b^2\right )}{f (a \cos (2 (e+f x))+a+2 b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.057, size = 60, normalized size = 1.1 \begin{align*}{\frac{{a}^{2}\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}}+2\,{\frac{ab\ln \left ( \tan \left ( fx+e \right ) \right ) }{f}}+{\frac{{b}^{2}}{2\,f \left ( \cos \left ( fx+e \right ) \right ) ^{2}}}+{\frac{{b}^{2}\ln \left ( \tan \left ( fx+e \right ) \right ) }{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.984089, size = 86, normalized size = 1.62 \begin{align*} -\frac{{\left (2 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) -{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac{b^{2}}{\sin \left (f x + e\right )^{2} - 1}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.535818, size = 203, normalized size = 3.83 \begin{align*} -\frac{{\left (2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (\cos \left (f x + e\right )^{2}\right ) -{\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (-\frac{1}{4} \, \cos \left (f x + e\right )^{2} + \frac{1}{4}\right ) - b^{2}}{2 \, f \cos \left (f x + e\right )^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2} \cot{\left (e + f x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.39487, size = 358, normalized size = 6.75 \begin{align*} -\frac{a^{2} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right ) +{\left (2 \, a b + b^{2}\right )} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 2\right ) - \frac{2 \, a b{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + b^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 4 \, a b - 2 \, b^{2}}{\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]